From 80899071cf5c7ca1c34e6b9bddab4295a6cc3789 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Sun, 27 Dec 2015 09:51:09 -0700 Subject: [PATCH] fix bug in xml_parse_time. we failed to carry any result from adding the time offset to the date. --- gpx.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gpx.cc b/gpx.cc index 0a62edd8b..e5fa054c1 100644 --- a/gpx.cc +++ b/gpx.cc @@ -862,16 +862,15 @@ xml_parse_time(const QString& dateTimeString) if (res > 0) { QDate date(year, mon, mday); QTime time(hour, min, sec); + dt = QDateTime(date, time, Qt::UTC); // Fractional part of time. if (fsec) { - time = time.addMSecs(lround(fsec * 1000)); + dt = dt.addMSecs(lround(fsec * 1000)); } // Any offsets that were stuck at the end. - time = time.addSecs(-off_sign * off_hr * 3600 - off_sign * off_min * 60); - - dt = QDateTime(date, time, Qt::UTC); + dt = dt.addSecs(-off_sign * off_hr * 3600 - off_sign * off_min * 60); } else { dt = QDateTime(); } -- 2.30.2